package cn.zktr.Personnel.controllers.tantiantian;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONArray;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

import cn.zktr.Personnel.model.dao.tantiantian.JnxxDao;
import cn.zktr.Personnel.model.pojos.PerPmsZJnxx;
import cn.zktr.Personnel.model.service.tantiantian.JiNengService;

@Controller
public class JiNengController {
	@Autowired 
	private JiNengService jser;
	

	
    //技能
    @RequestMapping("zyc/skills-table")
    public void skillstable(Model model) {
    	JSONArray cls = jser.select_cls();
    	model.addAttribute("cls",cls);
    	
    }
	
	@RequestMapping("select_jnxx")
	@ResponseBody
	public Map<String,Object> Paymenttable_ById(int page,int rows){
		Map<String,Object> map = new HashMap<>();
		map.put("total",jser.select_jineng().size());
		Page<Object> p=PageHelper.startPage(page,rows);
		//页内容
		map.put("rows",jser.select_jineng());
		
		return map;
	}
	//技能新增jineng_add
	@RequestMapping("jineng_add")
	@ResponseBody
	public void jineng_add(PerPmsZJnxx jnxx,Integer clsid){
		jser.jineng_add(jnxx,clsid);
	}
}
